<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-11-10 16:45:03
         compiled from "H:\WebApplication\myconpany\sumi_mobile\application\views\buy\detail.html" */ ?>
<?php /*%%SmartyHeaderCode:24642561b7b20a09e26-19791982%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '6b7a42476b6b282c9b6b0feca7701b88ea8b378f' => 
    array (
      0 => 'H:\\WebApplication\\myconpany\\sumi_mobile\\application\\views\\buy\\detail.html',
      1 => 1447038845,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '24642561b7b20a09e26-19791982',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.21-dev',
  'unifunc' => 'content_561b7b20deb236_84292917',
  'variables' => 
  array (
    'detail' => 0,
    '_BuyStartMean' => 0,
    '_BuyStateCfg' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_561b7b20deb236_84292917')) {function content_561b7b20deb236_84292917($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ((@constant('APPLICATION_PATH')).("/application/views/header.html"), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>


<!--header stop-->
<?php echo $_smarty_tpl->getSubTemplate ((@constant('APPLICATION_PATH')).("/application/views/common/headertitle.html"), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<!--header end-->
<div class="box-user">
<?php echo $_smarty_tpl->getSubTemplate ((@constant('APPLICATION_PATH')).("/application/views/common/headerMenu.html"), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>


<?php echo '<script'; ?>
>
    $(function(){
        $(".quote_btn").click(function(){
            var qid= $(this).attr('var');
            var Productid= $(this).attr('Productid');
            var Pid= $(this).attr('Pid');
            var Userid= $(this).attr('Userid');

            var body = $(".self-stock").next();

            quoteHTML($('body'),qid,Productid,Pid,Userid);
        });


        $(document).delegate(".submit_btn", "click", function(e){
            e.preventDefault();
            var qid = $("input[name=qid]").val();
            var product_id = $("input[name=product_id]").val();
            var price = $("input[name=price]").val();
            var num = $("input[name=num]").val();
            var deliveryarea = $("input[name=deliveryarea]").val();
            var content = $("#contents").val();
            var user_id = $("input[name=user_id]").val();
            var url = "/buy/savebuy";
            $.post(url, {
                price:price,
                num:num,
                delivery_area:deliveryarea,
                qid: qid,
                user_id:user_id,
                product_id:product_id,
                content: content
            },function(data){
                var data = eval("("+data+")");
                var code = data.code;
                var msg = data.msg;
                if(code == 1){
                    alert(msg);
                    window.location.href="/login";
                }else if(code == 8){
                    alert(msg);
                    window.location.reload();
                }else{
                    alert(msg);

                }
            });

        });


        $(document).delegate(".overlay-close", "click", function(){
            $(".eject-mask").remove();
             $(".eject-wrap").remove();
        });

        function quoteHTML(Obtn,Qid,Productid,Pid,Userid){
            var html =  "<div class=\"eject-mask\"></div>";
                html +=  "<div class=\"eject-wrap\">";
                html += "<div class=\"nav-h3\" style=\"margin: 0px;\"><p class=\"eject_titie\" style=\"margin: 0px;\"><span class=\"mp0\"></span><b class=\"cp0\">发布报价</b><a href=\"javascript:void(0)\" class=\"overlay-close\"></a></p></div>";
                html += "<p class=\"self_tm3 pl10p pr10p pt10p lh26p\">请在下方填写您的真实报价（价格必填）,并对您的货物描述清楚</p>";
                html += "<input type=\"hidden\" name=\"product_id\"  value=\'"+Productid+"\'>";
                html += "<input type=\"hidden\" name=\"p_id\" value=\'"+Pid+"\'>";
                html += "<input type=\"hidden\" name=\"user_id\"value=\'"+Userid+"\'>";
                html += "<input name=\'qid\' type=\'hidden\' value=\'"+Qid+"\'/> ";
                html += "<p class='mb10p'><span style=\"width:20%\" class='tar fl pt20p'>价格：</span><input type=\"text\" class=\"input_test1 mr5\" value=\"9000.00\" name=\"price\"></p><p class='mb10p'><span style=\"width:20%\"  class='tar fl pt20p'>数量：</span><input type=\"text\" class=\"input_test1 mr5\" value=\"120.000\" name=\"num\"></p><p class='mb10p'><span style=\"width:20%\"  class='tar fl pt20p'>交货地：</span><input type=\"text\" class=\"input_test1 mr5\" value=\"上海自提\" name=\"deliveryarea\"></p>";

            html +=  "<p class=\"pl10p pr10p\"><textarea class=\"self_textarea \" name=\"contents\" id=\"contents\"  placeholder=\'请输入您的报价内容\'></textarea></p>";
                html += "<p class=\"green self_tm3 ptb5p pl10p pr10p\">备注 : 不合理报价会被系统自动屏蔽</p>";
                html += "<p class=\"sst-btn submit_btn bgwhite\" style=\'margin: 0px;padding-bottom:50px;\'><a href=\"#\">提交报价</a></p>";
                html += "</div>";
            $(html).appendTo(Obtn);
        }
    });
<?php echo '</script'; ?>
>

<div class="self-stock">
    <p class="self-stock-title"><?php echo $_smarty_tpl->tpl_vars['detail']->value['cate_name'];?>
 <?php echo $_smarty_tpl->tpl_vars['detail']->value['product_name'];?>
 <?php echo $_smarty_tpl->tpl_vars['detail']->value['brand_name'];?>
 <span class="gray fr"><?php echo $_smarty_tpl->tpl_vars['detail']->value['update_time'];?>
</span><span class="fr"></span></p>
    <p class="fs20p orange pl10p pt10p"><span class="fs14p">￥</span><?php echo $_smarty_tpl->tpl_vars['detail']->value['price'];?>
<span class="fs14p">/吨</span><span class="sst-orange">实盘</span>
     
    </p>
    <p class="sst-te"><span class="sst-te1">数量：<?php echo $_smarty_tpl->tpl_vars['detail']->value['num'];?>
吨</span><span class="sst-te2">厂商：<?php echo $_smarty_tpl->tpl_vars['detail']->value['brand_name'];?>
</span></p>
    <p class="sst-te"><span class="sst-te1">交货地点：<?php echo $_smarty_tpl->tpl_vars['detail']->value['delivery_area'];?>
</span>
    <span class="sst-te2">交易状态：<?php echo $_smarty_tpl->tpl_vars['_BuyStartMean']->value[$_smarty_tpl->tpl_vars['detail']->value['status']];?>
</span></p>

    <?php if ($_smarty_tpl->tpl_vars['detail']->value['status']==$_smarty_tpl->tpl_vars['_BuyStateCfg']->value['audit']||$_smarty_tpl->tpl_vars['detail']->value['status']==$_smarty_tpl->tpl_vars['_BuyStateCfg']->value['Negotiate']) {?>
        <p class="sst-btn quote_btn" var="<?php echo $_smarty_tpl->tpl_vars['detail']->value['id'];?>
" Productid ="<?php echo $_smarty_tpl->tpl_vars['detail']->value['product_id'];?>
" Pid ="<?php echo $_smarty_tpl->tpl_vars['detail']->value['p_id'];?>
" Userid="<?php echo $_smarty_tpl->tpl_vars['detail']->value['user_id'];?>
"><a href="#" >我要报价</a></p>
    <?php } else { ?>
        <p class="sst-btn move-btn"><a href="#" class="gray">我要报价</a></p>
    <?php }?>

</div>






<div class="self_text">
    <div class="self_tm1">
        <p class="self_tm1_k0"><?php echo $_smarty_tpl->tpl_vars['detail']->value['business_name'];?>
</p>
        <p class="self_tm1_k3" style="margin-top: 0px;"><?php echo $_smarty_tpl->tpl_vars['detail']->value['contacts'];?>
</p>
        <p class="self_tm1_k2"><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=<?php echo $_smarty_tpl->tpl_vars['detail']->value['qq'];?>
&site=qq&menu=yes"><?php echo $_smarty_tpl->tpl_vars['detail']->value['qq'];?>
</a></p>
        <p class="self_tm1_k1"><a target="_blank" href="tel:<?php echo $_smarty_tpl->tpl_vars['detail']->value['mobile'];?>
"><?php echo $_smarty_tpl->tpl_vars['detail']->value['mobile'];?>
</a></p>
    </div>
    
</div>


</div>
<!--content end-->
<div class="s_ftel"><a href="tel:<?php echo $_smarty_tpl->tpl_vars['detail']->value['mobile'];?>
"><i></i>联系客户经理</a></div>
<?php }} ?>
